#ifndef QBINARYRPC_CLIENT_H
#define QBINARYRPC_CLIENT_H

#include "qbinaryrpc_dllprfx.h"
#include "qvariant.h"
#include "qhostaddress.h"

namespace qbinaryrpc {

class QBINARYRPC_DLLPRFX Client : public QObject {
  Q_OBJECT
public:
  Client();
  ~Client();
  void open(const QHostAddress &host, quint16 port);
  bool isOpen();
  void close();
  int request(const QString &method_name,
              const QVariantList &parameters = QVariantList());
signals:
  void done(int id, const QVariant &return_value);
  void fault(int id, int fault_code, const QString &fault_string);
private:
  class Private;
  Private *d;
};

} //namespace qbinaryrpc
#endif //QBINARYRPC_CLIENT_H
